home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
tppcx.exe
/
PCX.DOC
< prev
next >
Wrap
Text File
|
1991-01-29
|
29KB
|
611 lines
PCX.TPU - TPv6.0 Object-Oriented unit for displaying or saving PCX format
picture files on Hercules, EGA, VGA, or compatible adapters.
╔═════════╗
║ BasePCX ║█
╚═════════╝█
▀▀▀▀▀▀▀▀▀▀
The BasePCX object provides basic PCX functions that are independant of the
adapter type. This object is used in the abstract to create device dependant
objects.
RESTRICTIONS ─────────────────────────────────────────────────────────────────
This unit is for use only with EGA/ECM, VGA, and Hercules compatible devices.
Extended image files, ones exceeding the displaying device resolution,
cannot be read at this time and will generate a PCXError. Future versions
will handle panning. When reading a file which was created by a higher
resolution device than the device displaying the file, it may still be read
as long as the image dimensions do not exceed the display device resolution.
The image size can be set in the paint program before creating the picture if
you wish to make the PCX file compatible with several devices.
FIELDS ───────────────────────────────────────────────────────────────────────
PCXError PcxError: byte; Read only
Set to constant equivalent if an error is encountered in reading
writing from object.
See: BasePCX.GetPCXError
Loaded Loaded: boolean; Read/Write
Set to false at object initialization, it is set to true after a
picture has been loaded. It tells internal methods that a
picture has been loaded and if the image or portion of the image
is saved as another file, the existing color mapping is written
to the new file.
See: BasePCX.PCXLoaded
Hdr Hdr: Header; Read only
Record containing information pertaining to the picture file. The
record is filled when reading a PCX file from a 128 byte file
header that precedes the actual image data. The last 58 bytes of
the file header are just filler, so these are ignored. The header
record contains the following fields:
Maker: integer;
Code that specifies the picture generating program
conforms to PCX format. PCXError set if incorrect
maker, further methods halted.
Version: integer;
Code stating what PCX format version the following
picture file was created with. PCXError set if incor-
rect version, further methods halted.
Encoding: integer;
Code indicating the compression type of the following
picture file. PCXError set if not run-length encoded,
further methods halted.
bpp: integer;
Number indicating the number of bits per pixel per
plane. Not used in this unit version.
xmn: integer;
Number setting the upper left horizontal coordinate
of following picture.
See: BasePCX.GetXmn
ymn: integer;
Number setting the upper left vertical coordinate of
following picture.
See: BasePCX.GetYmn
xmx: integer;
Number setting the lower right horizontal coordinate
of following picture.
See: BasePCX.GetXmx
ymx: integer;
Number setting the lower right vertical coordinate of
following picture.
See: BasePCX.GetYmx
HRes: integer;
Number indicating the horizontal resolution of the
device that the created the picture file.
VRes: integer;
Number indicating the vertical resolution of the
device that created the picture file.
CMap: TripletArray;
2-dimensional array ( 16 triplets ) containing palette
information for the following picture. If the
following image is color and the displaying device
is an EGA/VGA, the color map is used and the palette
is set accordingly, if requested in the Show method.
Otherwise CMap is ignored.
Reserved: byte;
Filler number reserved by ZSoft.
NPlanes: byte;
Number of picture planes used to create the image.
Essentially establishes the differance between a mono
and color picture.
See: BasePCX.IsMultiPlane
NBpl: integer;
Number telling the object how many bytes are used to
store a single horizontal line of the picture in
memory.
Palett: integer;
Number for interpreting the palette. 0 = gray scale
iamge. 1 = color image.
Page Page: byte; Read only
Used when reading PCX files, it determines which video page the
image is written to. Since the object uses direct memory, the
picture is written to the page requested regardless of the
active page setting. The visual page setting still maintains
display control.
PFile PFile: pointer; Read only
Points to dynamic memory area where entire PCX file has been
read into ram. This increases decoding speed by reading the
compressed image data from ram instead of thru file I/O.
PCXError will be set if there is not enough memory available.
See: BasePCX.Done
SizeF SizeF: longint; Read only
Size of PCX file read into ram. Used for disposing memory when
destructing the object.
Buf Buf: PBuf; Read only
Pointer to dynamic variable (128 byte) which holds one complete
decoded/encoded scan line during the decoding or encoding
method.
Offset Offset: POffset; Read only
One-dimensional 480 byte array holding the video memory offset
address to the beginning of each horizontal scan line. The
offsets are calculated based on the object and not the creating
device.
Display Display: DisplayRec; Read/Write
Record variable set by descendant objects upon initialization
containing display adapter information. Correct information is
set based on the descendant type and not the creating device.
The record contains the following fields:
SegBase: word;
Base address to video memory.
Page0: word;
Offset from SegBase for start of video page 0.
Page1: word;
Offset from SegBase for start of video page 1.
HorizRes: integer;
Horizontal resolution of specific adapter.
Informative only, not used.
VertRes: integer;
Vertical resolution of specific adapter.
Informative only, not used.
BytesPerLine: integer;
Num